package com.googlecode.kipler.satisfiability.reasoner.profile;

import com.googlecode.kipler.container.dl.creational.ContainerType;
import com.googlecode.kipler.container.dl.creational.WcsFactory;
import com.googlecode.kipler.satisfiability.completion.strategy.CompletionStrategy;
import com.googlecode.kipler.satisfiability.completion.strategy.LTLALCCompletionStrategy;
import com.googlecode.kipler.satisfiability.reasoner.Reasoner;
import com.googlecode.kipler.transformations.SHIQPreprocessingStrategy;
import com.googlecode.kipler.transformations.SyntacticalProcessingStrategy;

public class LTLALCReasoningProfile implements ReasoningProfile {

	private CompletionStrategy completionStrategy;

	private SyntacticalProcessingStrategy preprocessingStrategy;

	private boolean logging;

	private boolean backjumping;

	private boolean unfoldableTBox;

	private Reasoner reasoner;

	public LTLALCReasoningProfile(Reasoner reasoner) {
		completionStrategy = new LTLALCCompletionStrategy(reasoner);
		preprocessingStrategy = new SHIQPreprocessingStrategy(reasoner);
		backjumping = true;
		unfoldableTBox = true;
		this.reasoner = reasoner;
	}

	public CompletionStrategy getCompletionStrategy() {
		return completionStrategy;
	}

	public SyntacticalProcessingStrategy getPreprocessingStrategy() {
		return preprocessingStrategy;
	}

	public String getIdentifier() {
		return "LTL_ALC";
	}

	public LTLALCReasoningProfile toggleLogging() {
		logging = !logging;
		return this;
	}

	public boolean isLoggingEnabled() {
		return logging;
	}

	public WcsFactory getWcsFactory() {
		return WcsFactory.getFactory(ContainerType.LTLALC,
				isUnfoldableTBoxEnabled(), reasoner);
	}

	public boolean isBackjumpingEnabled() {
		return backjumping;
	}

	public LTLALCReasoningProfile toggleBackjumping() {
		backjumping = !backjumping;
		return this;
	}

	@Override
	public boolean isUnfoldableTBoxEnabled() {
		return unfoldableTBox;
	}

	@Override
	public ReasoningProfile toggleUnfoldableTBox() {
		unfoldableTBox = !unfoldableTBox;
		return this;
	}

	@Override
	public boolean isInterpolationEnabled() {
		return false;
	}

	@Override
	public ReasoningProfile toggleInterpolation() {
		return this;
	}

}
